/*
 * @Autor: dingxiaolin
 * @Date: 2021-07-21 13:46:45
 * @LastEditors: dingxiaolin
 * @LastEditTime: 2021-07-21 14:09:49
 */
// 与vue2的里面的data一样，函数返回新对象防止多处共用同一对象,造成数据混乱
export const searchFormSchema: FormSchema[] = [
    // {
    //   field: 'deptName',
    //   label: '部门名称',
    //   component: 'Input',
    //   colProps: { span: 8 }
    // },
    // {
    //   field: 'status',
    //   label: '状态',
    //   component: 'Select',
    //   componentProps: {
    //     options: [
    //       { label: '启用', value: '0' },
    //       { label: '停用', value: '1' }
    //     ]
    //   },
    //   colProps: { span: 8 }
    // }
]

export const getFormSchema = (): FormSchema => ({
    formItem: [
        {
            type: 'input',
            label: '类型名称',
            field: 'name',
            value: '',
            props: {
                placeholder: '请输入类型名称'
            },
            rules: [
                {
                    required: true,
                    message: '类型名称不能为空'
                }
            ]
        },
        {
            type: 'input',
            label: '唯一编码',
            field: 'code',
            value: '',
            props: {
                placeholder: '请输入唯一编码'
            },
            rules: [
                {
                    required: true,
                    message: '唯一编码不能为空'
                }
            ]
        },
        {
            type: 'input-number',
            label: '排序',
            field: 'sort',
            value: '',
            props: {
                placeholder: '请输入排序',
                max: 999999,
                min: 0
            },
            rules: [
                {
                    required: true,
                    message: '排序不能为空'
                }
            ]
        },
        {
            type: 'textarea',
            label: '备注',
            field: 'remark',
            value: '',
            props: {
                placeholder: '备注信息'
            }
        }
    ]
})
